/** 
  * @author Ji Ye Choi <cgycgy@naver.com>
  * @version 1.12
  * @since 2010-11-27
  */ 

import javax.swing.*;
import java.awt.*;

@SuppressWarnings("serial")
public class DrawingFrame extends JFrame {
	public DrawingFrame() {
		super("Drawing Application");
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		JComponent drawingCanvas = createDrawingCanvas();
		add(drawingCanvas, BorderLayout.CENTER);

		JToolBar toolbar = createToolbar();
		add(toolbar, BorderLayout.NORTH);
	}

	private JComponent createDrawingCanvas() {
		JComponent drawingCanvas = new JPanel();
		drawingCanvas.setPreferredSize(new Dimension(400, 300));
		drawingCanvas.setBackground(Color.white);
		drawingCanvas.setBorder(BorderFactory.createEtchedBorder());
		return drawingCanvas;
	}

	private JToolBar createToolbar() {
		JToolBar toolbar = new JToolBar();
		JButton ellipseButton = new JButton("Ellipse");
		toolbar.add(ellipseButton);
		JButton squareButton = new JButton("Square");
                toolbar.add(squareButton);
		JButton RectButton = new JButton("Rect");
                toolbar.add(RectButton);

		return toolbar;
	}

	public static void main(String[] ar) {
		DrawingFrame drawFrame = new DrawingFrame();
		drawFrame.pack();
		drawFrame.setVisible(true);
	}
}

